import { Injectable, Logger } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { ConfigService } from '@nestjs/config';
import { BaseService } from '@wwjCommon/base/base.service';
import { CacheService } from '@wwjCommon/cache/cache.service';
import { LoggingService } from '@wwjCommon/logging/logging.service';
import { UploadService } from '@wwjVendor/upload/upload.service';
import { PayService } from '@wwjVendor/pay/pay.service';
import { SmsService } from '@wwjVendor/sms/sms.service';
import { NoticeService } from '@wwjVendor/notice/notice.service';

@Injectable()
export class H5Service extends BaseService<any> {
  private readonly logger = new Logger(H5Service.name);

  constructor(
    @InjectRepository(Object)
    protected readonly repository: Repository<any>,
    private readonly cacheService: CacheService,
    private readonly configService: ConfigService,
    private readonly loggingService: LoggingService,
    private readonly uploadService: UploadService,
    private readonly payService: PayService,
    private readonly smsService: SmsService,
    private readonly noticeService: NoticeService,
  ) {
    super(repository);
  }

  /**
   * setH5
   * 对应 PHP: H5Service_admin::setH5()
   * 逻辑类型: undefined - undefined
   */
  async setH5(value: any[]) {
    // 基于PHP真实逻辑: setH5
    // PHP原文: $data = [             'is_open' => $value['is_open']         ];         return $this->core_config_service->setConfig($this->site_id,ConfigKeyDict::H5,...
const data = [
            is_open: value.is_open
        ];
        return this.core_config_service.setConfig(this.site_id,ConfigKeyDict.H5, data);
    }

    /**
     * 获取h5配置
     * @return mixed
     */
    async getH5(){
        return this.coreH5Service.getH5(this.site_id);
    }
}
  }

  /**
   * getH5
   * 对应 PHP: H5Service_admin::getH5()
   * 逻辑类型: undefined - undefined
   */
  async getH5() {
    // 基于PHP真实逻辑: getH5
    // PHP原文: return (new CoreH5Service())->getH5($this->site_id);     } }...
return this.coreH5Service.getH5(this.site_id);
    }
}
  }
}
